                         LEC LogoTrans communicator
    Copyright (C) 2011 Joo Afonso <joaodiasafonso@gmail.com>

    This file is part of LEC Communicator.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    any later version.

    LEC LogoTrans Communicator is distributed in the hope that it will be useful, 
    but WITHOUT ANY WARRANTY; without even the implied warranty of 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
    General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with LEC LogoTrans communicator.  If not, see <http://www.gnu.org/licenses/>.



LEC LogoTrans comm app (leccomm)

Description:
- This app's purpose is to communicate with LEC LogoTrans application (tested only with LEC Power Translator 15) to make translations using stdIn and stdOut channels only.
- In this way, a third app can get translations easily by just managing both leccomm proccess channels.

Usage:
- leccomm [full path to LEC LogoTrans.exe]

How it works:
- After being initialized, app searches for an opened "LEC LogoTrans" window. If found, does not check path.
- If "LEC LogoTrans" window is not found, tries to open it by making a system call using the starting arguments (eg.: leccomm c:\program files\power translator 15\lec logotrans.exe)
- If for any reason after 10 seconds there's no LogoTrans proccess on memory, leccomm will close with exitcode 2.
- Assuming leccomm and LogoTrans are running, any text sent to leccomm's stdIn channel can be received in it's stdOut channel but already translated.
- Leccomm does it by identifying and making use of LogoTrans controls - puts text in inputBox, emulate the translate button pressing and gets translated text from outputBox.

Commands to control leccomm behaviour (sent to stdIn):
- TRANSLATE_FROM [LANGUAGE] - will change LogoTrans origin language, no return
- TRANSLATE_TO [LANGUAGE] - will change LogoTrans destination language, no return
- SWAP_LANG - will swap origin and destination languages, no return
- [text] - will be translated to TRANSLATE_TO language, returning the translated text immediately to stdOut

LANGUAGES:
Charset is not detailed, so Korean, Chinese, Russian, etc, will return strange characters. It works fairly for the following languages:
German, English, Spanish, French, Italian, Dutch, Polish, Portuguese

NOTE:
- LEC must be used in ENGLISH language, and set to use ENGLISH translation pairs (with LogoTrans opened, menu tools/options/miscellaneous, set English in Menu and Dialog Language; also, tools/options/languagePairs, set All pairs to or from English). Could be implemented differently, but this requirement exists because leccomm iterates over all LogoTrans controls to identify the ones it needs - and use the english labels to find them.
- Right before start LEC LogoTrans, LECCOMM defines ENGLISH and PORTUGUESE as origin and destination languages.

Requirements:
- Windows OS
- LEC Power Translator 15